class CreateInfobifs < ActiveRecord::Migration
  def self.up
    create_table :infobifs do |t|
      t.column :module,     :string, :limit => 1, :default => " ", :null => false
      t.column :batch_no,     :string, :limit => 4, :default => " ", :null => false              
      t.column :batch_id1,     :string, :limit => 25, :default => " ", :null => false
      t.column :interface,    :string, :limit => 25, :default => " ", :null => false
      t.column :voucher_type, :string, :limit => 25, :default => " ", :null => false
      t.column :trans_type,   :string, :limit => 2, :default => " ", :null => false
      t.column :client,       :string, :limit => 25, :default => " ", :null => false
      t.column :account,      :string, :limit => 25, :default => " ", :null => false
      t.column :dim_1,        :string, :limit => 25, :default => " ", :null => false
      t.column :tax_code,     :string, :limit => 25, :default => " ", :null => false
      t.column :tax_system,   :string, :limit => 25, :default => " ", :null => false
      t.column :currency,     :string, :limit => 25, :default => " ", :null => false
      t.column :cur_amount,   :decimal,  :default => 0, :null => false, :precision => 20, :scale => 2
      t.column :amount,       :decimal,  :default => 0, :null => false, :precision => 20, :scale => 2
      t.column :description,  :text,   :limit => 255,  :null => false
      t.column :trans_date,   :date,   :null => true
      t.column :voucher_date, :date,  :default => "2000-01-01", :null => false
      t.column :voucher_no,   :bigint, :limit => 15,    :default => 0, :null => false
      t.column :period,       :integer, :limit => 8,    :default => 0, :null => false
    end
  end

  def self.down
    drop_table :infobifs
  end
end
